﻿<?php
	
	function getLngFile()
	{
		global $default_lng;
		global $languages;
		global $lng;
		
		$languages = array('en'=>'English','pl'=>'Polski');
		$lng = $default_lng; 
		
		session_start();
		header('Cache-control: private'); // IE 6 FIX
		if(isSet($_GET['lng']))
		{
			$lng = $_GET['lng'];
			$_SESSION['lng'] = $lng;
			setcookie('lng', $lng, time() + (3600 * 24 * 30));
		}
		else if(isSet($_SESSION['lng']))
		{
			$lng = $_SESSION['lng'];
		}
		else if(isSet($_COOKIE['lng']))
		{
			$lng = $_COOKIE['lng'];
		}
		else
		{
			$lng = $default_lng;
		}
		if(!array_key_exists($lng, $languages))
			$lng = $default_lng;
			
		$lang_file = 'lang/lang_'.$lng.'.php';
		
		return $lang_file;
	}
	
	function drawReqHeader() {
		global $lang;
		echo '<tr>';
		echo '<th rowspan="2">'.$lang['LEVEL'].'</th>';
		echo '<th colspan="2">'.$lang['REQ_ROUND'].'</th><th colspan="2">'.$lang['REQ_MAP'].'</th><th colspan="2">'.$lang['REQ_TOTAL'].'</th>';
		echo '</tr>';
		echo '<tr>';
		echo '<th>'.$lang['KILLS'].'</th><th>'.$lang['HEADSHOTS'].'</th><th>'.$lang['KILLS'].'</th><th>'.$lang['HEADSHOTS'].'</th><th>'.$lang['KILLS']?></th><th><?=$lang['HEADSHOTS'].'</th>';
		echo '</tr>';
	}
?>